﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Numerics;
using System.Drawing;


namespace Fractalz.FractalModels
{
	class MandelbrotModel : IRenderable
	{
		protected Bitmap bitmap;
		protected Render.ColorMap colorMap;
		protected Render.Filter currentFilter;
		protected double midpointX;
		protected double midpointY;
		protected double distanceX;
		protected double distanceY;
		protected Size resolution;
		protected int antiAliasLevel;
		protected ComplexAlgorithms.IComplexAlgorithm selectedAlgorithm;
		protected TimeSpan remainingTime { get; private set; }
		protected TimeSpan elapsedTime { get; private set; }
		protected DateTime timeRenderStarted { get; private set; }
		protected DateTime timeRenderFinished { get; private set; }
		protected bool sleeping = false;
		protected double[,] dataGrid;
		

		public TimeSpan RemainingTime
		{
			get { return remainingTime; }
		}

		public TimeSpan ElapsedTime
		{
			get	{ return elapsedTime; }
		}

		public DateTime TimeRenderStarted
		{
			get	{ return timeRenderStarted;	}
		}

		public DateTime TimeRenderFinished
		{
			get { return timeRenderFinished; }
		}


		public void render(Object args)
		{
			Render.RenderArgs threadInfo = (Render.RenderArgs)args;
			int numPixels = bitmap.Size.Width * bitmap.Size.Height * antiAliasLevel * antiAliasLevel;
			int doublewidth = bitmap.Size.Width * antiAliasLevel;
			int doubleheight = bitmap.Size.Height * antiAliasLevel;
			Complex samplePoint;
			for (int i = threadInfo.threadNumber; i < numPixels; i += threadInfo.numThreads)
			{
				samplePoint = mapToCoordinates(i / doublewidth, i % doublewidth);
			}

		}

		private Complex mapToCoordinates(int SampleRow, int SampleColumn)
		{
			return new Complex(0,0);
		}


		public Render.RenderStatus getStatus()
		{
			throw new NotImplementedException();
		}


		public bool Sleeping
		{
			get { return sleeping; }
			set { sleeping = value; }
		}








		protected class SavedSettings
		{
			
		}
	}
}
